package com.ddwl.common.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.*;
import org.springframework.stereotype.Component;

/**
 * @author Fu Zhaohui
 * @date 15-1-19
 */
@Component
public class RedisService {

    @Autowired
    private StringRedisTemplate template;

    public HashOperations<String, String, String> getHashOps() {
        return this.template.opsForHash();
    }

    public ListOperations<String, String> getListOps() {
        return this.template.opsForList();
    }

    public ValueOperations<String, String> getValueOps() {
        return this.template.opsForValue();
    }

    public GeoOperations<String, String> getGeoOps() {
        return this.template.opsForGeo();
    }

    public SetOperations<String, String> getSetOps() {
        return this.template.opsForSet();
    }

    public ZSetOperations<String, String> getZSetOps() {
        return this.template.opsForZSet();
    }

    public ClusterOperations<String, String> getClusterOps() {
        return this.template.opsForCluster();
    }
}
